package com.monlyu.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.monlyu.annotation.Comment;

/********************************************************************************
 * 
 * <b>功能描述☞</b>邮件信息<br>
 * 
 * <b>开发公司☞</b>重庆唯尼科技有限公司<br>
 * <b>版权☞</b>本文件归重庆唯尼科技有限公司所有<br>
 * <b>项目名☞</b>NewsSys<br>
 * <b>文件路径☞</b>com.monlyu.vo.Mail.java<br>
 * <b>开发日期☞</b>2010-2-6 <br>
 * 
 * @author zengjun
 * @since JDK 5
 * @version 1.0.8
 * 
 ********************************************************************************/
@Entity(name = "t_mail")
@Comment(common = "邮件表")
public class Mail extends BaseVo {

	/** 新邮件 */
	public static final int MAIL_STATUS_NEW = 0;

	/** 已读 */
	public static final int MAIL_STATUS_READ = 1;

	/** 废弃 */
	public static final int MAIL_STATUS_DELETE = 2;

	@Id
	@Column(name = "m_id")
	@Comment(common = "ID编号")
	private Long id;

	@Column(name = "m_title", length = MAX_VCHAR_MYSQL)
	@Comment(common = "主题")
	private String title;

	@Comment(common = "发送者")
	@ManyToOne
	@JoinColumn(name = "m_senderid", nullable = false)
	private User sender;

	@Comment(common = "接受者")
	@ManyToOne
	@JoinColumn(name = "m_receiverid", nullable = false)
	private User receiver;

	@Column(name = "m_content", length = LENGTH_8000, nullable = false)
	@Comment(common = "内容")
	private String content;

	@Column(name = "m_createdate", nullable = false)
	@Comment(common = "发送时间")
	private Date createDate;

	@Column(name = "m_status")
	@Comment(common = "邮件状态，0：新邮件；1：已读；2：废弃")
	private int status;
	
	@Column(name = "m_receiverRemove")
	@Comment(common = "接受者是否废弃")
	private boolean receiverRemove;
	
	@Column(name = "m_senderRemove")
	@Comment(common = "发送者是否废弃")
	private boolean senderRemove;
	
	@Column(name = "m_receiverDelete")
	@Comment(common = "接受者是否删除")
	private boolean receiverDelete;
	
	@Column(name = "m_senderDelete")
	@Comment(common = "发送者是否删除")
	private boolean senderDelete;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public boolean isReceiverDelete() {
		return receiverDelete;
	}

	public boolean isReceiverRemove() {
		return receiverRemove;
	}

	public void setReceiverRemove(boolean receiverRemove) {
		this.receiverRemove = receiverRemove;
	}

	public boolean isSenderRemove() {
		return senderRemove;
	}

	public void setSenderRemove(boolean senderRemove) {
		this.senderRemove = senderRemove;
	}

	public void setReceiverDelete(boolean receiverDelete) {
		this.receiverDelete = receiverDelete;
	}

	public boolean isSenderDelete() {
		return senderDelete;
	}

	public void setSenderDelete(boolean senderDelete) {
		this.senderDelete = senderDelete;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public User getSender() {
		return sender;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setSender(User sender) {
		this.sender = sender;
	}

	public User getReceiver() {
		return receiver;
	}

	public void setReceiver(User receiver) {
		this.receiver = receiver;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
}
